<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : nt_300_08.jsp
    Description : 이벤트참여수정
    author Seung Won
    since 2012. 7. 19.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 7. 19.     Seung Won     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/co/mn/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/co/mn/include/session.jspf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/co/mn/include/header.jspf" %>
<script type="text/javaScript" language="javascript">
<!--
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    
    $("#listButn").bind("click", moveListPage);     // 목록
    $("#updButn").bind("click", moveUpdPage);       // 수정
    $("#cnclButn").bind("click", formIniz);         /* Form 초기화 */
});

/*
 * 검색
 */
function moveListPage() {
    $("#mainForm").attr('target','_self');
    $("#mainForm").attr('action','/nt_300_06.do').submit();
}

/*
 * 수정
 */
function moveUpdPage() {
    if (!validateForm($("#mainForm"))) {
        return;
    }
    
    if($("#sbc").val().length == 0) {
        alert("필수항목 입니다.");
        $("#sbc").focus();
        return;
    }
    
    $("#aplcEml").val($("#aplcEml1").val()+"@"+$("#aplcEml2").val());
    
    if($("#sbc").val().length > 400) {
        alert("400자 이내로 작성하여주세요");
        $("#sbc").focus();
        return;
    }
    
    $("#mainForm").attr('target','comIframe');
    $("#mainForm").attr('action','/nt_300_09.do').submit();
}

/*
 * Form 초기화
 */
function formIniz() {
    document.mainForm.reset();
}

/*
 * 주소 찾기 팝업 창
 */
function popupCenter() {
   
    var left = (screen.width/2)-(445/2); 
    var top = (screen.height/2)-(490/2); 
    var targetWin = window.open ('/CO000013.do', 'adrPop', 'scrollbars=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, copyhistory=no, width=445, height=490, top='+top+', left='+left); 
} 

//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HMC GLOBAL CSR</title>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/mn/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <!-- LNB -->
        <%@ include file="/WEB-INF/jsp/co/mn/include/left.jsp" %>
        <!-- LNB -->
        
        <div id="contents">
            
            <!-- location -->
            <%@ include file="/WEB-INF/jsp/co/mn/include/location.jsp" %>
            <!-- location -->
            <p class="msgTbtitle"><strong>함께 움직이는 세상 공모사업</strong></p>
            <form id="mainForm" name="mainForm" method="post" enctype="multipart/form-data">
            <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo}" />
            <input type="hidden" id="parp02Idx" name="parp02Idx" value="${result.parp02Idx }" />
            <input type="hidden" id="evntIdx" name="evntIdx" value="${result.evntIdx }" />
            <input type="hidden" id="srchEvntIdx" name="srchEvntIdx" value="${result.srchEvntIdx }" />
            <input type="hidden" id="srchScn" name="srchScn" value="${result.srchScn }" />
            <input type="hidden" id="srchTxt" name="srchTxt" value="${result.srchTxt }" />
            <table border="1" class="frmTable" summary="공모사업의 성명,분류구분,비밀번호를 입력또는 수정하는 표">
                <col width="25%" />
                <col width="75%" />
                <tbody>
                    <tr>
                        <th>성명</th>
                        <td><input type="text" class="frmName" id="ppprNm" name="ppprNm" value="${result.ppprNm }" maxbyte="20" nullable="true" title="성명"/></td>
                    </tr>
                    <tr>
                        <th>분류구분</th>
                        <td class="hpSection">
                            <select id="hdcClCd" name="hdcClCd">
                                <option value="1" <c:if test="${result.hdcClCd == '1' }">selected</c:if>>전체</option>
                                <option value="2" <c:if test="${result.hdcClCd == '2' }">selected</c:if>>사회복지 | 장애인</option>
                                <option value="3" <c:if test="${result.hdcClCd == '3' }">selected</c:if>>사회복지 | 아동 및 청소년</option>
                                <option value="4" <c:if test="${result.hdcClCd == '4' }">selected</c:if>>사회복지 | 노인</option>
                                <option value="5" <c:if test="${result.hdcClCd == '5' }">selected</c:if>>이동복지 | 장애인</option>
                                <option value="6" <c:if test="${result.hdcClCd == '6' }">selected</c:if>>이동복지 | 아동 및 청소년</option>
                                <option value="7" <c:if test="${result.hdcClCd == '7' }">selected</c:if>>이동복지 | 노인</option>
                                <option value="8" <c:if test="${result.hdcClCd == '8' }">selected</c:if>>기타</option>
                            </select>
                        </td>
                    </tr>
                </tbody>
            </table>
            <p class="msgTbtitle"><strong>신청단체</strong></p>
            <table border="1" class="frmTable" summary="신청단체의 단체명,단체장, 전화번호,이메일,주소,사업명,첨부파일,내용을 입력또는 수정하는 표">
                <col width="25%" />
                <col width="75%" />
                <tbody>
                    <tr>
                        <th>단체명</th>
                        <td><input type="text" id="crpNm" name="crpNm" value="${result.crpNm }" maxbyte="100" nullable="true" title="단체명" /></td>
                    </tr>
                    <tr>
                        <th>단체장</th>
                        <td><input type="text" class="frmName" id="myr" name="myr" value="${result.myr }" maxbyte="20" nullable="true" title="단체장" /></td>
                    </tr>
                    <tr>
                        <th>전화번호</th>
                        <td>
                            <select id="aplcCcpc1" name="aplcCcpc1">
                                <option value="02" <c:if test="${result.aplcCcpc1 == '02' }">selected</c:if> >02</option>
                                <option value="070" <c:if test="${result.aplcCcpc1 == '070' }">selected</c:if> >070</option>
                                <option value="031" <c:if test="${result.aplcCcpc1 == '031' }">selected</c:if> >031</option>
                                <option value="032" <c:if test="${result.aplcCcpc1 == '032' }">selected</c:if> >032</option>
                                <option value="033" <c:if test="${result.aplcCcpc1 == '033' }">selected</c:if> >033</option>
                                <option value="041" <c:if test="${result.aplcCcpc1 == '041' }">selected</c:if> >041</option>
                                <option value="042" <c:if test="${result.aplcCcpc1 == '042' }">selected</c:if> >042</option>
                                <option value="043" <c:if test="${result.aplcCcpc1 == '043' }">selected</c:if> >043</option>
                                <option value="051" <c:if test="${result.aplcCcpc1 == '051' }">selected</c:if> >051</option>
                                <option value="052" <c:if test="${result.aplcCcpc1 == '052' }">selected</c:if> >052</option>
                                <option value="053" <c:if test="${result.aplcCcpc1 == '053' }">selected</c:if> >053</option>
                                <option value="061" <c:if test="${result.aplcCcpc1 == '061' }">selected</c:if> >061</option>
                                <option value="062" <c:if test="${result.aplcCcpc1 == '062' }">selected</c:if> >062</option>
                                <option value="063" <c:if test="${result.aplcCcpc1 == '063' }">selected</c:if> >063</option>
                            </select> - <input type="text" class="frmCall" title="앞자리" id="aplcCcpc2" name="aplcCcpc2" value="${result.aplcCcpc2 }" maxlength="4" nullable="true" chartype="int" /> - 
                            <input type="text" class="frmCall" title="뒤 4자리" id="aplcCcpc3" name="aplcCcpc3" value="${result.aplcCcpc3 }" maxlength="4" nullable="true" chartype="int" />
                        </td>
                    </tr>
                    <tr>
                        <th>휴대전화</th>
                        <td>
                            <select id="aplcHp1" name="aplcHp1">
                              <option value="010" <c:if test="${result.aplcHp1 == '010' }">selected</c:if> >010</option>
                                <option value="011" <c:if test="${result.aplcHp1 == '011' }">selected</c:if> >011</option>
                                <option value="016" <c:if test="${result.aplcHp1 == '016' }">selected</c:if> >016</option>
                                <option value="017" <c:if test="${result.aplcHp1 == '017' }">selected</c:if> >017</option>
                                <option value="019" <c:if test="${result.aplcHp1 == '019' }">selected</c:if> >019</option>
                            </select> - <input type="text" class="frmCall" title="앞자리" id="aplcHp2" name="aplcHp2" value="${result.aplcHp2 }" maxlength="4" nullable="true" chartype="int" /> - 
                            <input type="text" class="frmCall" title="뒤 4자리" id="aplcHp3" name="aplcHp3" value="${result.aplcHp3 }" maxlength="4" nullable="true" chartype="int" />
                        </td>
                    </tr>
                    <tr>
                        <th>이메일</th>
                        <td><input type="text" class="frmEmail" id="aplcEml1" name="aplcEml1" value="${arrAplcEml[0] }" maxlength="14" nullable="true" title="이메일" style="ime-mode:inactive" />&nbsp;@&nbsp;
                            <input type="text" class="frmEmail" id="aplcEml2" name="aplcEml2" value="${arrAplcEml[1] }" maxlength="14" nullable="true" title="이메일" style="ime-mode:inactive" />
                            <input type="hidden" id="aplcEml" name="aplcEml" value="${result.aplcEml }" /></td>
                    </tr>
                    <tr>
                        <th>주소</th>
                        <td>
                            <fieldset class="address">
                                <legend class="invisible">주소 검색</legend>
                                <span><input type="text" class="zipCode" title="우편번호 앞자리" value="${result.zip1 }" id="zip1" name="zip1" nullable="true" readOnly />&nbsp;-&nbsp;<input type="text" class="zipCode" title="우편번호 뒷자리" value="${result.zip2 }" id="zip2" name="zip2" nullable="true" readOnly />&nbsp;<a href="javascript:void(0);" onclick="popupCenter();"><img src="/img/mng/btn/btn_zip_code.gif" alt="우편번호검색" /></a></span>
                                <span class="frmaAdrs"><input type="text" class="adrs" title="주소" value="${result.adrBasc }" id="adrBasc" name="adrBasc" nullable="true" readOnly /><input type="text" title="나머지 주소" value="${result.adrDtl }" id="adrDtl" name="adrDtl" nullable="true" /></span>
                            </fieldset>
                        </td>
                    </tr>
                    <tr>
                        <th>사업명</th>
                        <td><input type="text" value="${result.bzrNm }" id="bzrNm" name="bzrNm" maxbyte="100" nullable="true" /></td>
                    </tr>
                    <tr>
                        <th>첨부파일</th>
                        <td>
                            <div class="imgUpload">
                                <p><able:file name="attcFile" fixed="true" filename="" maxsize="30" sizeunit="M" sub="common" classType=""/></p> 
                            </div>
                            <c:if test="${result.parp02Idx != null}">
                            <p class="attachedFile"><a href="#" onclick="getUpFileDownload('0220','${result.parp02Idx}');return false;">${result.filNm }</a></p>
                            </c:if>
                        </td>
                    </tr>
                    <tr>
                        <th>내용</th>
                        <td><textarea rows="4" cols="85" id="sbc" name="sbc" class="applyTxtarea">${result.sbc }</textarea></td>
                    </tr>
                </tbody>
            </table>
            </form>
            <div class="btnBoard">
                <span class="flow">
                    <input type="submit" id="listButn" title="목록" value="목록" />
                </span>
                <span class="reverse">
                    <input type="submit" id="updButn" title="수정" value="수정" />
                    <input type="submit" id="cnclButn" title="취소" value="취소" />
                </span>
            </div>
        </div>
    </div>
            
    <!-- /container -->

    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/mn/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>